//
//  GetHightTools.m
//  UI13-cell的高度自适应
//
//  Created by dllo on 16/6/22.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "GetHightTools.h"

@implementation GetHightTools

+ (CGFloat)getHeight:(NSString *)text width:(CGFloat)width font:(UIFont *)font{
    NSDictionary *attributesDic = @{
                                    NSFontAttributeName:font
                                    };
    CGRect rect = [text boundingRectWithSize:CGSizeMake(width, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributesDic context:nil];
    return rect.size.height;
}

+ (CGFloat)imageHeightWith:(NSString *)imageName{
    UIImage *image = [UIImage imageNamed:imageName];
    CGFloat height =image.size.height *[UIScreen mainScreen].bounds.size.width / image.size.width;
    return height;                     //宽度可以自定义
}




























@end
